<?php

namespace App\Params\Common;

use App\Params\BaseParam;

class SpecialEditParams extends BaseParam
{
    public $special_id;

    public $label;

    public $price;

    public $album_id;

    public $sell_time;

    public $user_num;

    public $one_num;

    public $story;

    public $mid;


    public function rules()
    {
        return [
            'mid'        => 'required|string',
            'label' => 'array',
            'price' => 'numeric|gte:0.00',
            'album_id' => 'required|integer',
            'sell_time' => 'required|date',
            'user_num' => 'integer',
            'one_num' => 'integer',
            'story'      => 'required|string',
            'special_id' => 'required|integer',
        ];
    }

    public function message()
    {
        return [
            "mid.required"       => "商户号不能为空",
            "all_count.required" => "铸造数量不能为空",
            "all_count.min"      => "铸造数量最小为1",
            "story.required"     => "故事不能为空",
            "type.required"     => "类型不能为空",
            "type.in"     => "类型参数异常",
            "price.numeric" => "价格参数异常",
            "price.gte" => "价格参数异常",
            "album_id.required" => "专辑参数不能为空",
            "album_id.integer" => "专辑参数异常",
            "sell_time.required" => "参数售卖时间不能为空",
            "sell_time.date" => "售卖时间参数格式不正确",
            "user_num.integer" => "最大购买数量参数异常",
            "one_num.integer" => "单次购买数量参数异常",
        ];
    }

    public function getMid()
    {
        return $this->mid;
    }


    public function getSpecialId()
    {
        return $this->special_id;
    }

    public function getLabel()
    {
        return $this->label;
    }

    public function getPrice()
    {
        return $this->price;
    }

    public function getAlbumId()
    {
        return $this->album_id;
    }

    public function getSellTime()
    {
        return $this->sell_time;
    }

    public function getUserNum(): int
    {
        return (int)$this->user_num;
    }

    public function getOneNum(): int
    {
        return (int)$this->one_num;
    }

    public function getStory()
    {
        return $this->story;
    }
}
